home *** CD-ROM | disk | FTP | other *** search
- Path: news.accent.net!news
- From: dallaire@megatoon.com (Guy Dallaire)
- Newsgroups: comp.lang.c
- Subject: HELP: system() exit status
- Date: Fri, 12 Apr 1996 00:35:01 GMT
- Organization: Accent Internet
- Message-ID: <4kk8m6$omb@news.accent.net>
- NNTP-Posting-Host: 198.53.28.127
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi,
-
- I have a program which does a lot of "system()" calls here. Is it
- safe to assume that ANY return code other than 0 (on a UNIX) system
- means that the command specified as a parameter to system() did dot
- work ?
-
- NOTE: I also checked for -1 which indicates that system() could not
- spawn the command.
-
- Also: Most man pages do not explicitly state what return status one
- can expect after calling some system call/utility. For example, it's
- not stated that the `cp` command exits with value x, y, or z depending
- on the case where the source file is not present, the destination file
- is write protect, anmd so on. Can was assume that any return status of
- 0 means that all went well and anything else means there has been an
- error ?
-
- That question always puzzled me...
-
- Thanks !
-
- P.S.: Please reply by e-mail also
-
-